/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi;

import java.util.List;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;

/**
 *
 * @author nekdo
 */
@Stateless
@Local(value=AircraftServiceLocal.class)
public class AircraftService implements AircraftServiceLocal{
    
    @Resource
    private SessionContext ctx;
    
    @EJB
    private AircraftDaoLocal aircraftDao;

    public void setCtx(SessionContext ctx) {
        this.ctx = ctx;
    }

    public void setAircraftDao(AircraftDaoLocal aircraftDao) {
        this.aircraftDao = aircraftDao;
    }

    @Override
    public void create(Aircraft aircraft) {
        aircraftDao.create(aircraft);
    }

    @Override
    public Aircraft get(Long id) {
        return aircraftDao.get(id);
    }

    @Override
    public void update(Aircraft aircraft) {
        aircraftDao.update(aircraft);
    }

    @Override
    public void remove(Aircraft aircraft) {
        aircraftDao.remove(aircraft);
    }

    @Override
    public List<Aircraft> findAll() {
        return aircraftDao.findAll();
    }

    @Override
    public Aircraft findByCode(String code) {
        return aircraftDao.findByCode(code);
    }
    
}
